/**
 * Created by Baggio on 2019-1-14.
 */
$.ajax({
    type: "get",
    url: "/order/getOrderList",
    dataType: "json",
    async: false,
    data: postData,
    success: function (res) {
        console.log(res);
        if (res.code != 1) {
            alert(res.msg);
            return;
        }
        showData(res.data);
    }

});

function showData(data) {

    var html = "";

    for (var i = 0; i < data.length; i++) {
        html += " <div class=\"box_1\">";
        html += " <div class=\"top\">";
        html += "     <span class=\"time\">2017-12-20</span>";
        html += "     <span class=\"number\">订单号:"+data[i].orderId+"</span>";
        html += "  <span class=\"state\">"+data[i].status+"</span>";
        html += "     </div>";
        html += "      <div class=\"information_box\">";
        html += "    <div class=\"img_box\"><img src=\"img/t007.png\" alt=\"\"></div>";
        html += "     <div class=\"information_box_1\">";
        html += "    <h5>6苏泊尔保温饭盒KF20H1 三层大容量双层保温 304不锈钢提锅饭桶送保温包餐具</h5>";
        html += "   <h5><span class=\"color\">颜色：</span><span>黑色</span></h5>";
        html += "  <h5><span class=\"package\">套餐：</span><span>套餐一</span></h5>";
        html += "   <h5>￥"+data[i].orderPrice+"</h5>";
        html += "   </div>";
        html += "  </div>";
        html += "   <div class=\"state_box\">";
        html += "    <a href=\"\" class=\"btn btn_1\">确认收货</a>";
        html += "     </div>";
        html += "    </div>";
    }
    $("#orderList").html(html);
}